<div id="product_discount_detail_modal" class="modal fade">
    <div class="modal-dialog" >
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">商品折扣</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="col-sm-1"></div>
                        <div class="col-sm-3">
                            <label class="control-label">仓库名：</label>
                        </div>
                        <div class="col-sm-6">
                            <label id="repository_name" class="control-label"></label>
                        </div>
                    </div>

                    <div class="col-sm-12">
                        <br>
                        <div class="col-sm-1"></div>
                        <div class="col-sm-3">
                            <label class="control-label">商品名称：</label>
                        </div>
                        <div class="col-sm-6">
                            <label id="product_name" class="control-label">黄秋葵</label>
                        </div>
                    </div>

                    <div class="col-sm-12">
                        <br>
                        <div class="col-sm-1"></div>
                        <div class="col-sm-3">
                            <label class="control-label">商品条形码：</label>
                        </div>
                        <div class="col-sm-6">
                            <label id="barcode" class="control-label"></label>
                        </div>
                    </div>

                    <form id="product_discount_detail_form" action='{:U("Admin/Product/updateProductDiscount")}' method="post">
                    <div class="form-group">
                        <div class="col-sm-12">
                            <br>
                            <div class="col-sm-1"></div>
                            <div class="col-sm-3" style="padding-top:5px">
                                <label for="cx_price" class="control-label">促销价格：</label>
                            </div>
                            <div class="col-sm-6">
                                <input id="product_discount_id" name="product_discount_id" class="form-control" style="display:none;"></input>
                                <input id="cx_price" name="cx_price" class="form-control"></input>
                            </div>
                        </div>

                        <div class="col-sm-12">
                            <br>
                            <div class="col-sm-1"></div>
                            <div class="col-sm-3" style="padding-top:5px">
                                <label for="cx_amount" class="control-label">促销量：</label>
                            </div>
                            <div class="col-sm-6">
                                <input id="cx_amount" name="cx_amount" class="form-control"></input>
                            </div>
                        </div>

                        <div class="col-sm-12">
                            <br>
                            <div class="col-sm-1"></div>
                            <div class="col-sm-3" style="padding-top:5px">
                                <label for="xg_amount" class="control-label">限购量：</label>
                            </div>
                            <div class="col-sm-6">
                                <input id="xg_amount" name="xg_amount" class="form-control"></input>
                            </div>
                        </div>

                        <div class="col-sm-12">
                            <br>
                            <div class="col-sm-1"></div>
                            <div class="col-sm-3" style="padding-top:5px">
                                <label for="index" class="control-label">排序：</label>
                            </div>
                            <div class="col-sm-6">
                                <input id="index" name="index" class="form-control"></input>
                            </div>
                        </div>
                    </div>
                    </form>

                </div>
            </div>

            <div class="modal-footer">
                <button class="btn btn-primary" onclick="submit()">保存</button>
                <button class="btn btn-defalt" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<script>
function submit(){
    $('#product_discount_detail_form').ajaxSubmit({      
        success:function(data){
            $('#product_discount_detail_modal').modal('hide');
            location.reload();
        }
    });
}
</script>